package com.cwt.service.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Objects;

import lombok.Data;

/**
 *
 * @TableName tb_book
 */
@TableName(value ="tb_book")
@Data
public class TbBook implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 书籍名
     */
    private String name;

    /**
     * 作者
     */
    private String author;

    /**
     * 价格
     */
    private String price;

    /**
     * 销量
     */
    private String sales;

    /**
     * 库存
     */
    private String stock;

    /**
     * 书籍图片地址 书籍图片地址
     */
    @TableField(value = "bookImage")
    private String bookImage;

    /**
     * 是否热门， 0：否 1：是
     */
    @TableField(value = "isHot")
    private Integer isHot;

    /**
     * 是否畅销， 0：否 1：是
     */
    @TableField(value = "isWell")
    private Integer isWell;

    /**
     * 类型id
     */
    private Integer typeid;

    /**
     * 发布状态 ，0：未发布 1：已发布
     */
    private Integer state;

    /**
     * 著作时间
     */
    @TableField(value = "workTime")
    private String workTime;

    /**
     * 书籍简介
     */
    @TableField(value = "bookDes")
    private String bookDes;

    /**
     * 发布人
     */
    @TableField(value = "releaseUser")
    private String releaseUser;

    /**
     * 发布时间
     */
    @TableField(value = "releaseTime")
    private String releaseTime;

    /**
     * 创建人
     */
    @TableField(value = "createUser")
    private String createUser;

    /**
     * 创建时间
     */
    @TableField(value = "createTime")
    private String createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbBook tbBook = (TbBook) o;
        return getId().equals(tbBook.getId()) && getName().equals(tbBook.getName()) && getAuthor().equals(tbBook.getAuthor()) && getPrice().equals(tbBook.getPrice()) && getSales().equals(tbBook.getSales()) && getStock().equals(tbBook.getStock()) && getBookImage().equals(tbBook.getBookImage()) && getIsHot().equals(tbBook.getIsHot()) && getIsWell().equals(tbBook.getIsWell()) && getTypeid().equals(tbBook.getTypeid()) && getState().equals(tbBook.getState()) && getWorkTime().equals(tbBook.getWorkTime()) && getBookDes().equals(tbBook.getBookDes()) && getReleaseUser().equals(tbBook.getReleaseUser()) && getReleaseTime().equals(tbBook.getReleaseTime()) && getCreateUser().equals(tbBook.getCreateUser()) && getCreateTime().equals(tbBook.getCreateTime());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getName(), getAuthor(), getPrice(), getSales(), getStock(), getBookImage(), getIsHot(), getIsWell(), getTypeid(), getState(), getWorkTime(), getBookDes(), getReleaseUser(), getReleaseTime(), getCreateUser(), getCreateTime());
    }

    @Override
    public String toString() {
        return "TbBook{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", price='" + price + '\'' +
                ", sales='" + sales + '\'' +
                ", stock='" + stock + '\'' +
                ", bookImage='" + bookImage + '\'' +
                ", isHot=" + isHot +
                ", isWell=" + isWell +
                ", typeid=" + typeid +
                ", state=" + state +
                ", workTime='" + workTime + '\'' +
                ", bookDes='" + bookDes + '\'' +
                ", releaseUser='" + releaseUser + '\'' +
                ", releaseTime='" + releaseTime + '\'' +
                ", createUser='" + createUser + '\'' +
                ", createTime='" + createTime + '\'' +
                '}';
    }
}
